home *** CD-ROM | disk | FTP | other *** search
/ Complete Internet Archive / Complete Internet Archive.iso / Winsock Libraries / ipack(2).exe / FTPCONN.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-12-29  |  4.6 KB  |  156 lines

  1. VERSION 4.00
  2. Begin VB.Form frmConnection 
  3.    BorderStyle     =   0  'None
  4.    ClientHeight    =   3165
  5.    ClientLeft      =   1140
  6.    ClientTop       =   1515
  7.    ClientWidth     =   3705
  8.    ControlBox      =   0   'False
  9.    Height          =   3570
  10.    Left            =   1080
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MDIChild        =   -1  'True
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3165
  16.    ScaleWidth      =   3705
  17.    ShowInTaskbar   =   0   'False
  18.    Top             =   1170
  19.    Width           =   3825
  20.    Begin VB.Timer Timer1 
  21.       Interval        =   100
  22.       Left            =   120
  23.       Top             =   2400
  24.    End
  25.    Begin VB.TextBox txtAccount 
  26.       Height          =   285
  27.       Left            =   1080
  28.       TabIndex        =   10
  29.       Top             =   1200
  30.       Width           =   2175
  31.    End
  32.    Begin VB.TextBox txtPassword 
  33.       Height          =   285
  34.       Left            =   1080
  35.       TabIndex        =   9
  36.       Text            =   "nobody@nowhere.com"
  37.       Top             =   840
  38.       Width           =   2175
  39.    End
  40.    Begin VB.TextBox txtUsername 
  41.       Height          =   285
  42.       Left            =   1080
  43.       TabIndex        =   8
  44.       Text            =   "anonymous"
  45.       Top             =   480
  46.       Width           =   2175
  47.    End
  48.    Begin VB.TextBox txtHost 
  49.       Height          =   285
  50.       Left            =   1080
  51.       TabIndex        =   4
  52.       Text            =   "ftp.microsoft.com"
  53.       Top             =   120
  54.       Width           =   2175
  55.    End
  56.    Begin VB.CommandButton cmdReinit 
  57.       Caption         =   "Reinit"
  58.       Enabled         =   0   'False
  59.       Height          =   375
  60.       Left            =   2280
  61.       TabIndex        =   2
  62.       Top             =   1800
  63.       Width           =   975
  64.    End
  65.    Begin VB.CommandButton cmdDisconnect 
  66.       Caption         =   "Disconnect"
  67.       Enabled         =   0   'False
  68.       Height          =   375
  69.       Left            =   1200
  70.       TabIndex        =   1
  71.       Top             =   1800
  72.       Width           =   975
  73.    End
  74.    Begin VB.CommandButton cmdConnect 
  75.       Caption         =   "Connect"
  76.       Height          =   375
  77.       Left            =   120
  78.       TabIndex        =   0
  79.       Top             =   1800
  80.       Width           =   975
  81.    End
  82.    Begin VB.Label Label4 
  83.       Alignment       =   1  'Right Justify
  84.       Caption         =   "Account:"
  85.       Height          =   255
  86.       Left            =   120
  87.       TabIndex        =   7
  88.       Top             =   1200
  89.       Width           =   855
  90.    End
  91.    Begin VB.Label Label3 
  92.       Alignment       =   1  'Right Justify
  93.       Caption         =   "Password:"
  94.       Height          =   255
  95.       Left            =   120
  96.       TabIndex        =   6
  97.       Top             =   840
  98.       Width           =   855
  99.    End
  100.    Begin VB.Label Label2 
  101.       Alignment       =   1  'Right Justify
  102.       Caption         =   "Username:"
  103.       Height          =   255
  104.       Left            =   120
  105.       TabIndex        =   5
  106.       Top             =   480
  107.       Width           =   855
  108.    End
  109.    Begin VB.Label Label1 
  110.       Alignment       =   1  'Right Justify
  111.       Caption         =   "Host:"
  112.       Height          =   255
  113.       Left            =   120
  114.       TabIndex        =   3
  115.       Top             =   120
  116.       Width           =   855
  117.    End
  118. Attribute VB_Name = "frmConnection"
  119. Attribute VB_Creatable = False
  120. Attribute VB_Exposed = False
  121. Option Explicit
  122. Dim fConnected As Boolean
  123. Private Sub cmdConnect_Click()
  124.    MainForm.Ftp1.Host = txtHost.Text
  125.    MainForm.Ftp1.LogonName = txtUsername.Text
  126.    MainForm.Ftp1.LogonPassword = txtPassword.Text
  127.    MainForm.Ftp1.Account = txtAccount.Text
  128.    MainForm.Ftp1.Action = FtpActionConnect
  129.    End Sub
  130. Private Sub cmdDisconnect_Click()
  131.    MainForm.Ftp1.Action = FtpActionDisconnect
  132.    End Sub
  133. Private Sub cmdReinit_Click()
  134.    MainForm.Ftp1.Action = FtpActionReinitialize
  135.    End Sub
  136. Private Sub Form_Load()
  137.    txtHost.Text = "ftp.mabry.com"
  138.    txtUsername.Text = "anonymous"
  139.    txtPassword.Text = "test@ftp.ocx"
  140.    fConnected = False
  141.    Me.Show
  142.    End Sub
  143. Private Sub Timer1_Timer()
  144.    If (fConnected = False And MainForm.Ftp1.State = 1) Then
  145.       cmdDisconnect.Enabled = True
  146.       cmdConnect.Enabled = False
  147.       cmdReinit.Enabled = True
  148.       fConnected = True
  149.    ElseIf (fConnected = True And MainForm.Ftp1.State = 0) Then
  150.       cmdDisconnect.Enabled = Not True
  151.       cmdConnect.Enabled = Not False
  152.       cmdReinit.Enabled = Not True
  153.       fConnected = False
  154.       End If
  155.    End Sub
  156.